<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.rmi.StubNotFoundException" %>
<%@ page import="com.itheima.bean.Student" %><%--
  Created by IntelliJ IDEA.
  User: Cloudy
  Date: 2020/11/1
  Time: 21:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查看学生</title>
</head>
<body>
    <table width="600px" border="1px">
        <tr>
            <th>编号</th>
            <th>学生姓名</th>
            <th>学生年龄</th>
            <th>学生成绩</th>
        </tr>
        <%--在会话域中获取学生集合对象,遍历学生集合,显示到页面--%>
        <c:forEach items="${students}" var="student" varStatus="s">
        <tr align="center">
            <td>${s.count}</td>
            <td>${student.username}</td>
            <td>${student.age}</td>
            <td>${student.score}</td>
        </tr>
        </c:forEach>


        <%--<%
            ArrayList<Student> students = (ArrayList<Student>) request.getAttribute("students");
            for(Student student : students) {
        %>
        <tr align="center">
            <td><%=student.getUsername()%></td>
            <td><%=student.getAge()%></td>
            <td><%=student.getScore()%></td>
        </tr>
        <%}%>--%>
    </table>
</body>
</html>
